package com.smartphonedev.function;

import com.smartphonedev.activity.MainActivity;
import com.smartphonedev.activity.R;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;

public class Notify {

	public static void showNotification(Context context, NotificationManager NM, String sms) {
		// In this sample, we'll use the same text for the ticker and the expanded notification
		CharSequence text = sms;

		// Set the icon, scrolling text and timestamp
		Notification notification = new Notification(R.drawable.tab1ic48x48, text,
				System.currentTimeMillis());

		// The PendingIntent to launch our activity if the user selects this notification
		PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
				new Intent(context, MainActivity.class), 0);

		// Set the info for the views that show in the notification panel.
		notification.setLatestEventInfo(context, context.getString(R.string.app_name),
				text, contentIntent);

		// Send the notification.
		// We use a layout id because it is a unique number.  We use it later to cancel.
		NM.notify(R.string.app_name, notification);
	}


	public static void showNotification2(Context context, NotificationManager NM, String sms) {
		// In this sample, we'll use the same text for the ticker and the expanded notification
		CharSequence text = sms;

		// Set the icon, scrolling text and timestamp
		Notification notification = new Notification(R.drawable.tab2ic48x48, text,
				System.currentTimeMillis());

		// The PendingIntent to launch our activity if the user selects this notification
		PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
				new Intent(context, MainActivity.class), 0);

		// Set the info for the views that show in the notification panel.
		notification.setLatestEventInfo(context, context.getString(R.string.app_name),
				text, contentIntent);

		// Send the notification.
		// We use a layout id because it is a unique number.  We use it later to cancel.
		NM.notify(R.string.app_name, notification);
	}

}
